Public Class frmMain

    Private Sub Main_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        Call updateLabels()
    End Sub

    Private Sub UpdateLabels()
        Dim dt As New DataTable()
        Dim connStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=MEGACITIES.MDB"
        Dim sqlStr As String = "SELECT * FROM Countries"
        Dim dataAdapter As New OleDb.OleDbDataAdapter(sqlStr, connStr)
        dataAdapter.Fill(dt)
        dataAdapter.Dispose()

        lblCountries.Text = "There are " & dt.Rows.Count & " countries in the Database"

        sqlStr = "SELECT * FROM Cities"
        dataAdapter = New OleDb.OleDbDataAdapter(sqlStr, connStr)
        dt = New DataTable()
        dataAdapter.Fill(dt)
        dataAdapter.Dispose()

        lblCities.Text = "There are " & dt.Rows.Count & " Cities in the Database"


    End Sub

    Private Sub btnEditCities_Click(sender As System.Object, e As System.EventArgs) Handles btnEditCities.Click
        frmCountry.Show()
    End Sub

    Private Sub btnEditCountries_Click(sender As System.Object, e As System.EventArgs) Handles btnEditCountries.Click
        frmCountries.Show()
    End Sub
End Class